<script setup>
const props = defineProps(['title','showTitle'])
const goHome = () => {
  uni.switchTab({
    url: '/pages/index/index'
  })
}
const back = () => {
  uni.navigateBack()
}
</script>

<template>
  <uv-navbar leftText="返回" :fixed="false" :title="props.showTitle?props.title:''" :safeAreaInsetTop="false">
    <template v-slot:left>
      <view class="uv-nav-slot">
        <uv-icon name="arrow-left" size="19" @click="back"></uv-icon>
        <uv-line direction="column" :hairline="false" length="16" margin="0 8px"></uv-line>
        <uv-icon name="home" size="20" @click="goHome"></uv-icon>
      </view>
    </template>
  </uv-navbar>
</template>

<style scoped lang="scss">
@mixin flex($direction: row) {
  /* #ifndef APP-NVUE */
  display: flex;
  /* #endif */
  flex-direction: $direction;
}
.uv-nav-slot {
  @include flex;
  align-items: center;
  justify-content: space-between;
  border-width: 0.5px;
  border-radius: 100px;
  border-color: #dadbde;
  padding: 3px 7px;
  opacity: 0.8;
}
</style>
